<html xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:p="http://primefaces.prime.com.tr/ui"
	  xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<link rel="stylesheet" href="js/analiz.css" />
</h:head>

<h:body>
	<f:view>
	
	<p:layout fullPage="true">
		<p:layoutUnit position="top" height="45" id="topAnaliz" >
		<center>
		<ui:include src="/includes/menu.xhtml"/>
		</center>
		</p:layoutUnit>
	
	<p:layoutUnit position="center" >
		<h:form prependId="false">
			<div class="options">
				<p:commandButton styleClass="buttonOptions" update="users" actionListener="#{userBean.saveUpdate}" image="ui-icon ui-icon-disk" title="Save"/>
				<p:commandButton styleClass="buttonOptions" type="reset" image="ui-icon ui-icon-arrowrefresh-1-w" title="Cancel"/>
				<p:commandButton styleClass="buttonOptions" type="button" onclick="confirmation.show()" image="ui-icon ui-icon-close" title="Delete" />
			
			<p:confirmDialog message="Delete Users?"  
                showEffect="bounce" hideEffect="explode"  
                header="Delete" severity="alert" widgetVar="confirmation">  
                  
		        <p:commandButton value="Yes Sure" update="users" oncomplete="confirmation.hide()"  
		                    actionListener="#{userBean.delete}" />  
		        <p:commandButton value="Not Yet" onclick="confirmation.hide()" type="button" />   
                  
    		</p:confirmDialog>
			
			</div>
	
			<div class="cadastro">
				<p:fieldset id="fieldset" legend="User" toggleable="true" toggleSpeed="500" onToggleUpdate="growl">  
				    <h:panelGrid  id="grid" columns="3">
				    	<h:outputText value="Name: " />  
				        <p:inputText value="#{userBean.user.user}" id="user" required="true"/>  
				        <p:message for="user" />
				        <h:outputText value="Passeword " />  
				        <p:password feedback="false" value="#{userBean.user.senha}" id="senha" required="true"/>  
				        <p:message for="senha" />
				    </h:panelGrid >
    			</p:fieldset>
    		</div>
    		<div class="listagem">
    			<p:dataTable id="users" selection="#{userBean.selectedUsers}" var="user"
    			 value="#{userBean.users}" paginator="true" rows="10"   >  
			  
			  		<p:column selectionMode="multiple" /> 
			  		
			  		<p:column>  
			            <f:facet name="header">  
			                    ID  
			            </f:facet>  
			            <h:outputText value="#{user.id}" />  
			        </p:column>  
			  		
			        <p:column>  
			            <f:facet name="header">  
			                    Name  
			            </f:facet>  
			            <h:outputText value="#{user.user}" />  
			        </p:column>  
			  
			        <p:column>  
			            <f:facet name="header">  
			                    Password  
			            </f:facet>  
			            <h:outputText value="#{user.senha}" />  
			        </p:column> 
			        
			        <p:column style="width:32px">  
            			<p:commandButton update="grid"  
                    		image="ui-icon ui-icon-search">  
                		<f:setPropertyActionListener value="#{user}"  
                    		target="#{userBean.user}" />  
            			</p:commandButton>  
        			</p:column>  
  
    			</p:dataTable>  
    		</div>
    		
    	</h:form>
	</p:layoutUnit>
	
	<p:layoutUnit position="bottom" height="20">
	Analiz 2011
	</p:layoutUnit>
	
	</p:layout>
	
	</f:view>
</h:body>
</html>